function plan1() {
    $.ajax({
       url:"/planfind",
       type:"post",
       dataType:"json",
       contentType:"application/json",
       success:function (data) {
        console.log(data);
             $("#tbodyDome").html="";
             console.log(data);
             for (var i=0;i<data.length;i++){
                  var plan =data[i];
                 $("#tbodyDome").append(`
                      <tr class="text-c va-m">
                     <td><input type="checkbox" name="" value=""></td>
                     <td>${plan.annual}</td>
                     <td>${plan.name}</td>
                     <td>${plan.auditName}</td>
                     <td>${plan.planType}</td>
                     <td>${plan.state}</td>
                     <td>${plan.uname}</td>
                     <td>${new Date(plan.operating).getFullYear()+"-"+ (new Date(plan.operating).getMonth()+1)+"-"+ new Date(plan.operating).getDate()}</td>
                     </tr>`)
             }
           },
       error:function (data) {
           console.log("出现信息错误")
       }
    });
}
function count() {
    $.ajax({
        url:"/plancount",
        type:"post",
        dataType:"json",
        success:function (data) {
            $("#count").html=""
            console.log(data);
            var dome1 = data[4]/(data[0]+data[1])*100
            var dome2 = data[5]/(data[0]+data[1])*100
            var dome3 = ((data[4]+data[5])/((data[0]+data[1]))*100)
            var resule = dome3.toFixed(0);
            $("#count").append(`
                <tr class="text-c va-m" >
                    <td>年度计划</td>
                    <td>${data[0]}</td>
                    <td>${data[2]}</td>
                    <td>${data[4]}</td>
                    <td>${dome1.toFixed(0)}%</td>
                    </tr>
                    <tr class="text-c va-m">
                    <td>新增计划</td>
                     <td>${data[1]}</td>
                    <td>${data[3]}</td>
                    <td>${data[5]}</td>
                    <td>${dome2.toFixed(0)}%</td>
                    </tr>
                    <tr class="text-c va-m" >
                    <td>合计</td>
                    <td>${data[0]+data[1]}</td>
                    <td>${data[2]+data[3]}</td>
                    <td>${data[4]+data[5]}</td>
                    <td>${dome3.toFixed(0)}%</td>
                </tr>
                `)
        },
        error:function (data) {
            console.log("出现信息错误")
        }
    });
}
plan1();
count();

